//
//  CentRedBagNONoticeFieldTableViewCell.m
//  智积分
//
//  Created by Cynic on 2018/7/27.
//  Copyright © 2018年 Cynic. All rights reserved.
//

#import "CentRedBagNONoticeFieldTableViewCell.h"

@implementation CentRedBagNONoticeFieldTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    
    WEAKSELF;
    UIView *layerView = [[UIView alloc] initWithFrame:CGRectZero];
    layerView.backgroundColor = [UIColor whiteColor];
    //    layerView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    layerView.layer.cornerRadius = 5;
    [self.contentView addSubview:layerView];
    [layerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.right.mas_equalTo(-12);
        make.height.mas_equalTo(55);
        make.top.mas_equalTo(10);
        make.bottom.mas_equalTo(0);
        //        make.bottom.mas_equalTo(0);
        //        make.bottom.mas_equalTo(-10);
    }];
    
    _title = [[UILabel alloc] initWithFrame:CGRectZero];
    _title.font = [UIFont systemFontOfSize:14];
    _title.numberOfLines = 0;
    _title.textColor = [UIColor blackColor];
    [layerView addSubview:_title];
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(15);
        make.centerY.mas_equalTo(0);
        //        make.height.mas_equalTo();
    }];
    
    _field = [[UITextField alloc] initWithFrame:CGRectZero];
    _field.font = [UIFont systemFontOfSize:14];
    _field.textColor = [UIColor ColorWithHex:@"666666" withAlpha:1];
    _field.max = 10;
    _field.textAlignment = NSTextAlignmentRight;
    [layerView addSubview:_field];
    [_field mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        //        make.left.mas_equalTo(15);
        make.left.mas_equalTo(weakSelf.title.mas_right).mas_equalTo(10);
        //        make.top.mas_equalTo(15);
        //        make.bottom.mas_equalTo(-15);
        make.centerY.mas_equalTo(0);
    }];
    
    

    
    
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
